package com.ruoyi.business.service;

import com.ruoyi.business.domain.Category;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * CategoryService接口
 *
 * @author win
 * @date 2021-06-14
 */
public interface ICategoryService
{
    /**
     * 查询Category
     *
     * @param id CategoryID
     * @return Category
     */
    public Category selectCategoryById(Long id);

    /**
     * 查询Category列表
     *
     * @param category Category
     * @return Category集合
     */
    public List<Category> selectCategoryList(Category category);

    /**
     * 新增Category
     *
     * @param category Category
     * @return 结果
     */
    public int insertCategory(Category category);

    /**
     * 修改Category
     *
     * @param category Category
     * @return 结果
     */
    public int updateCategory(Category category);

    /**
     * 批量删除Category
     *
     * @param ids 需要删除的CategoryID
     * @return 结果
     */
    public int deleteCategoryByIds(Long[] ids);

    /**
     * 删除Category信息
     *
     * @param id CategoryID
     * @return 结果
     */
    public int deleteCategoryById(Long id);

    /**
     * 获取栏目树
     * @param allList
     * @param parent
     * @return
     */
    Category queryTree(List<Category> allList, Category parent);

    Integer countCategories(Integer position);

    List<Category> queryChildrenList(List<Category> allList, List<Category> childrenList, Category parentCategory);

    void queryParentNames(List<Category> allList, Category category, ArrayList<Map<String, Object>> names);
}
